<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="java.util.*,com.epam.tcs.actions.*,com.epam.tcs.dao.hibernate.entities.*"%>
<%@ include file="../template/header.jsp" %>
<%@ include file="../template/left_menu_alt.jsp" %>
<div id="content">
		<div id="breadcrumbs">
		<c:if test="${requestScope.breadcrumbs != null}">
			<c:set var="i" value="0"/>
			<c:forEach items="${requestScope.breadcrumbs}" var="bc">
				<a href="${pageContext.request.contextPath}${bc.getUrl()}">${bc.getCaption()}</a>		
			</c:forEach>
		</c:if>
	</div>
	<span style="color: green;">
		${requestScope.message}
	</span>
	<form name="learning_form" action="${pageContext.request.contextPath}/tcs/learning" method="post">
	<input type="hidden" name="program" value="${sessionScope.current_program.program_id}"/>
	<input type="hidden" name="theme" value="${sessionScope.current_theme.theme_id}"/>
	<input type="hidden" name="group" value="${sessionScope.current_group.group_id}"/>
	<c:choose>
	<c:when test="${sessionScope.current_program == null || sessionScope.current_theme == null || sessionScope.current_group == null}">
	<div class="window">
		<div class="window_header">
			<p>Установите программу, тему и группу сегодняшнего занятия.</p>
		</div>
		<table>
			<tr>
				<th>Программа</th>
				<th>Тема</th>
				<th>Группа</th>
			</tr>
			<tr>
				<td>
					<select name="selected_program">
						<c:forEach items="${sessionScope.listPrograms}" var="p">
							<option value="${p.program_id}">${p.name}</option>
						</c:forEach>					
					</select>
				</td>
				<td>
					<select name="selected_theme">
						<c:forEach items="${sessionScope.listThemes}" var="t">
							<option value="${t.theme_id}">${t.name}</option>
						</c:forEach>	
					</select></td>
				<td>
					<select name="selected_group">
						<c:forEach items="${sessionScope.listGroups}" var="g">
							<option value="${g.group_id}">${g.name}</option>
						</c:forEach>	
					</select>
				</td>
			</tr>
		</table>
	</div>
	</c:when>
	<c:when test="${sessionScope.current_program != null && sessionScope.current_theme != null && sessionScope.current_group != null}">
	<div class="current_status">Программа: ${sessionScope.current_program.name} --- Тема: ${sessionScope.current_theme.name} --- Группа: ${sessionScope.current_group.name}</div>
	<div class="window">
		<div class="window_header">
			<p>Лекции:</p>
		</div>
		<div class="left_side">
			<p class="text_left">Все</p>
			<c:forEach items="${sessionScope.current_theme.lectures}" var="l">
				<p><a href="${pageContext.request.contextPath}/tcs/lecture/show?lecture_id=${l.lecPracId}">${l.name}</a></p>
			</c:forEach>
		</div>
		<div class="right_side">
			<p class="text_left">Назначенные на группу</p>
			<table>
				<tr>
					<th>Лекция</th>
					<th>Дата</th>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>
			</table>
		</div>
		<div style="clear:both;"></div>
	</div>
	<div class="window">
		<div class="window_header">
			<p>Практики:</p>
		</div>
		<div class="left_side">
			<p class="text_left">Все</p>
			<c:forEach items="${sessionScope.current_theme.practices}" var="p">
				<p><a href="/tcs/lecture/show?practice_id=${p.lecPracId}">${p.name}</a></p>
			</c:forEach>
		</div>
		<div class="right_side">
			<p class="text_left">Назначенные на группу</p>
		</div>
		<div style="clear:both;"></div>
	</div>	
	</c:when>
	</c:choose>
	<input type="submit" class="button"/>
	</form>
</div>
<%@ include file="../template/footer.jsp" %>